class Alg<T extends Comparable<T>>{
   /* public T findMax(T[] array){
        T max = array[0];
        for (int i = 0; i < array.length; i++) {
            if (array[i].compareTo(max) > 0){
                max = array[i];
            }
        }
        return max;
    }*/
    public static <T extends Comparable<T>> T findmax(T[] array1){
        T max = array1[0];
        for (int i = 0; i < array1.length; i++) {
            if (array1[i].compareTo(max) > 0){
                max = array1[i];
            }
        }
        return max;
    }
}
public class demo3 {
    public static void main(String[] args) {
       // Alg<Integer> alg = new Alg<>();
        Integer[] array = {1,2,3,4,5};
        System.out.println(Alg.findmax(array));
    }
}
